<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ include file="../common.jsp"%>
<%@ page import="org.springside.core.Constants"%>
<%@ page import="cn.firstsoft.firstframe.admin.ExportSQL"%>
<%@ page import="java.util.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  
    
    <title>组织架构迁移</title>

  </head>
  
  <body>
  <%
   		ExportSQL e = new ExportSQL();
   		String type = request.getParameter("type");
   		String dbType = request.getParameter("dbtype");
   		String id = request.getParameter("id");
   		List list = e.export(id,type,dbType,"system");
   		if(list == null)
   		{
   			out.println("没有找到要导出的表，请检查export.properties文件！");
   			return;
   		}
  %>
  导出完毕！

  <c:set var="sqlList" value="<%=list%>" />
   	
 
   	<font size=1><TEXTAREA cols="100" rows="20"><c:forEach items="${sqlList}" var="list">${list}</c:forEach></TEXTAREA></font>
   	<p/>
   	<%
   		String filePath = "";
   		if(dbType.equals("sqlserver"))
   			filePath = Constants.MAIN_STORAGE_DIR + File.separator + "dataSQL" + File.separator + "SqlServer_Insert.sql";
   		else
   			filePath = Constants.MAIN_STORAGE_DIR + File.separator + "dataSQL" + File.separator + "Oracle_Insert.sql";
   		
   	%>
   	<a href="<%=filePath%>">下载脚本(右键另存为...)</a>
  </body>
</html>